Skip to content

feat(cli): add shell completion support#974

Open
nekomoyi wants to merge 5 commits intovoidzero-dev:mainfrom
nekomoyi:feat/cli-completion
Open

feat(cli): add shell completion support#974
nekomoyi wants to merge 5 commits intovoidzero-dev:mainfrom
nekomoyi:feat/cli-completion

Conversation

@nekomoyi
Copy link
Contributor

@nekomoyi nekomoyi commented Mar 16, 2026

Summary

Implements shell completion for the vp CLI.

Changes

Completion scripts for bash, zsh, fish, and PowerShell are generated in ~/.vite-plus/completion/ when running vp env setup, and automatically sourced in the respective env files.

Fixes

Fixed mixed path separators in env files on Windows to use forward slashes consistently for $HOME-relative paths

# Before
__vp_bin="$HOME/.vite-plus\bin"
# After
__vp_bin="$HOME/.vite-plus/bin"

Increased stack size to 8MB to handle deep recursion in clap_complete::generate() which exceeds Windows' default stack size.

Closes #950

@netlify
Copy link

netlify bot commented Mar 16, 2026

Deploy Preview for viteplus-preview ready!

Name Link
🔨 Latest commit 37f6497
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69b90b2e6344d300083a4eb8
😎 Deploy Preview https://deploy-preview-974--viteplus-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@fengmk2 fengmk2 self-requested a review March 17, 2026 03:39
@nekomoyi
Copy link
Contributor Author

Looking into the CI failure.

@nekomoyi nekomoyi marked this pull request as draft March 17, 2026 07:22
…ive paths

Fix mixed path separators in env files on Windows
- Before: $HOME/.vite-plus\bin (mixed)
- After: $HOME/.vite-plus/bin (consistent)
Simplify completion generation with loop-based approach
…dows

- Increase stack size to 8MB on Windows
- Set RUST_MIN_STACK to 8MB in CI test jobs

Cargo test default (2MB) are insufficient for deep recursion in clap_complete::generate(). This causes stack overflow when generating shell completion scripts during tests.
@nekomoyi nekomoyi marked this pull request as ready for review March 17, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shell completion support

1 participant